'use strict';
let unility  = require('../common/unility');


//验证安装程序是否执行
module.exports = async function (req, res, next) {
    let params  = unility.getConfig();
    let reqPath = req.path;
    if(params.installStatus==='install'){
        if(reqPath.indexOf('install')==1){
            res.redirect('/');
            return;
        }
    }
    else{
        if(reqPath.indexOf('install')!=1){ 
        res.redirect('/install');
        return; 
        }
    }

  next();
};